//
//  MYHomeSubclassListCollViewCell.m
//  MuYing
//
//  Created by tbb on 2019/7/23.
//  Copyright © 2019 TBB. All rights reserved.
//

#import "MYHomeSubclassListCollViewCell.h"

@implementation MYHomeSubclassListCollViewCell


- (void)awakeFromNib {
    [super awakeFromNib];
    self.callBtn.imagePosition = QMUIButtonImagePositionLeft;
    self.callBtn.spacingBetweenImageAndTitle = 4;
    [self.callBtn setImage:YQIMG(@"common_home_call_icon") forState:(UIControlStateNormal)];
    [self.callBtn setTitle:@"0" forState:(UIControlStateNormal)];
    [self.callBtn setTitleColor:kAPPMainTitleColor forState:(UIControlStateNormal)];
    self.callBtn.titleLabel.font = kSystemMedium(12);
    self.userHeaderIcon.layer.cornerRadius = 8;
    self.userHeaderIcon.contentMode = UIViewContentModeScaleAspectFill;
    self.userHeaderIcon.clipsToBounds = true;
    
    self.topImageView.contentMode = UIViewContentModeScaleAspectFill;
    self.topImageView.clipsToBounds = true;
    
    self.topImageView.userInteractionEnabled = YES;
    self.layer.cornerRadius = 8.0;
    self.clipsToBounds = true;
}

- (void)setModel:(YQPTiesModel *)model
{
    _model = model;
    [self.topImageView sd_setImageWithURL:[NSURL URLWithString:model.coverImg] placeholderImage:IMAGE_NAMED(@"Test_Rectangle_icon")];
    [self.userHeaderIcon sd_setImageWithURL:[NSURL URLWithString:model.headImg.length>0?model.headImg:[YQPUserTool account].userHead] placeholderImage:IMAGE_NAMED(@"Test_Rectangle_icon")];

    self.contentLb.text = model.title;
    [self.callBtn setTitle:model.likeNumber.length >0?model.likeNumber:@"0" forState:UIControlStateNormal];
    self.userNameLb.text = model.name;
}

@end
